using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Data;
using ICachePolicy = PHSRAG.Insight21.Policy.ICachePolicy;

namespace PHSRAG.Insight21.FormsManagement
{
	/// <summary>
	/// CustomValueSelectorQuestion abstracts the notion of a QuestionnaireItem which 
	/// allows the user to specify a URL and select a value from this page
	/// </summary>
	public class CustomValueSelectorQuestion : QuestionnaireItem
	{
		public class PropertyNames
		{
			public const string PageUrlProperty = "PageUrl";
		}

		/// <summary>
		/// Constructs a new CustomValueSelectorQuestion object based on the Cache Policy passed in as a parameter. 
		/// All the instance variables will be set to default values of their associated types.
		/// </summary>
		/// <param name="cachePolicy">The prevalent cache policy</param>
		public CustomValueSelectorQuestion(ICachePolicy cachePolicy): base(cachePolicy)
		{
		}

		/// <summary>
		/// Constructs a new CustomValueSelectorQuestion object based on the Cache Policy passed in as a parameter. 
		/// All the instance variables will be set to the corresponding values specified in the Data Row
		/// </summary>
		/// <param name="cachePolicy">The prevalent cache policy</param>
		/// <param name="dataRow">DataRow holding the values to be assigned to instance variables</param>
		public CustomValueSelectorQuestion(ICachePolicy cachePolicy, DataRow dataRow)
			: base(cachePolicy, dataRow)
		{
		}
	
		/// <summary>
		/// Gets the type of the questionnaire item (CustomValueSelectorItemType)
		/// </summary>
		public override string Type
		{
			get { return QuestionnaireItem.CustomValueSelectorItemType; }
		}

		#region Static methods
		/// <summary>
		/// Gets all the existing custom value selection pages from the database
		/// </summary>
		/// <param name="connectionString">Information to connect to the db</param>
		/// <param name="moduleType">BitValue of the module the user is viewing</param>
		/// <returns></returns>
		public static DataTable GetCustomValueSelectionPages(string connectionString)
		{
			return Utility.DataAccess.GetDataTable(connectionString, "GetCustomValueSelectionPages");
		}
		#endregion

		

	}
}
